//
//  TCMyThirdTableViewCell.m
//  Project_B
//
//  Created by dllo on 15/11/25.
//  Copyright © 2015年 张闯. All rights reserved.
//

#import "TCMyThirdTableViewCell.h"
#import "UIImageView+WebCache.h"
#define WIDTH [[UIScreen mainScreen] bounds].size.width / 375
#define HEIGHT [[UIScreen mainScreen] bounds].size.height / 667
@interface TCMyThirdTableViewCell ()
@property (nonatomic, strong)UIImageView *bigimage;
@property (nonatomic, strong)UILabel *titlelabel;
@property (nonatomic, strong)UILabel *smalllabel;
@property (nonatomic, strong) UIImageView *subImgView;
@end

@implementation TCMyThirdTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.bigimage = [[UIImageView alloc]init];
        self.bigimage.layer.borderWidth = 1;
        self.bigimage.layer.borderColor = [UIColor colorWithRed:60.0 / 255 green:149.0 / 255 blue:58.0 / 255 alpha:1].CGColor;
//        self.bigimage.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.bigimage];
        
        self.titlelabel = [[UILabel alloc]init];
        self.titlelabel.textColor = [UIColor whiteColor];
//        self.titlelabel.alpha = 0.6;
        self.titlelabel.textAlignment = NSTextAlignmentCenter;
        [self.titlelabel setFont:[UIFont boldSystemFontOfSize:20]];
        self.titlelabel.shadowOffset = CGSizeMake(1.5, 1.5);
        self.titlelabel.shadowColor = [UIColor grayColor];
        [self.contentView addSubview:self.titlelabel];
        
        self.smalllabel = [[UILabel alloc]init];
        self.smalllabel.textColor = [UIColor whiteColor];
        self.smalllabel.shadowColor = [UIColor grayColor];
        self.smalllabel.shadowOffset = CGSizeMake(1, 1);
        self.smalllabel.textAlignment = NSTextAlignmentCenter;
        [self.smalllabel setFont:[UIFont systemFontOfSize:13]];
        [self.contentView addSubview:self.smalllabel];
        
        self.subImgView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.subImgView];
        [self.subImgView setImage:[UIImage imageNamed:@"zhuanti"]];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.bigimage.frame = CGRectMake(5*WIDTH, 5*HEIGHT, 365*WIDTH, self.contentView.frame.size.height - 10);
    self.subImgView.frame = CGRectMake(320*WIDTH, 30*HEIGHT, 30*WIDTH, 30*HEIGHT);
    self.titlelabel.frame = CGRectMake(0, 0, 300*WIDTH, 30*HEIGHT);
    self.titlelabel.center = self.contentView.center;
    self.smalllabel.frame = CGRectMake(self.titlelabel.frame.origin.x + 50, self.titlelabel.frame.origin.y + 30, 200, 30);
}
- (void)setTemp:(TCspecial *)temp
{
    if (self.temp != temp) {
        _temp = temp;
    }
    [self.bigimage sd_setImageWithURL:[NSURL URLWithString:temp.images] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
    self.titlelabel.text = temp.title;
    self.smalllabel.text = temp.subhead;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
